<!--
 * @author: wangshuaixue
 * @Date: 2024-10-17 10:50:00
 * @description: 
 * @LastEditTime: 2025-04-10 14:58:39
 * @LastEditors: wangshuaixue
 * @FilePath: /sqlsearch/src/views/sqlsearch/recommond.vue
-->
<template>
  <div class="recommond-wrap">
    <div class="title">
      <img src="@/assets/images/recommend.png" alt="" class="icon" />
      <span>试试以下问题</span>
    </div>
    <div class="recommond-container">
      <div
        class="recommond-q"
        v-for="(item, index) in props.questionList"
        :key="index"
        @click="emit('checkQuestion', item)"
      >
        <div class="q-title">{{ item.question }}</div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { defineProps, defineEmits } from "vue"

const emit = defineEmits()
const props = defineProps({
  questionList: {
    type: Array,
    default: () => []
  }
})
</script>
<style lang="scss" scoped>
.recommond-wrap {
  border-radius: 16px;
  background: linear-gradient(to bottom, #e3eefd, #f2f3f5);
}
.title {
  padding: 16px 0 16px 16px;
  display: flex;
  align-items: center;
  span {
    color: #333;
    font-size: 18px;
    font-weight: bold;
  }
  .icon {
    width: 30px;
    height: 30px;
    margin-right: 8px;
  }
}
.recommond-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  .q-title {
    white-space: nowrap;
    cursor: pointer;
    padding: 17px 16px;
    border-radius: 10px;
    margin: 0 16px 10px;
    color: #000;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid #ffffff;
    &:hover {
      color: #0c6bed;
      background: #ffffff;
      box-shadow: 0px 2px 8px 0px rgba(0, 15, 41, 0.1);
    }
    &:active {
      color: #444444;
      box-shadow: 0px 2px 8px 0px rgba(0, 15, 41, 0.1);
    }
  }
}
</style>
